﻿@model PagedList.IPagedList<VietPremier.EntityTravelCity>
@{
    ViewBag.Title = "AjaxListTravel";
}

<div class="row-fluid">
    <div class="span6 wheretosay">
        @{
            int count = Model.Count;
            for (int i = 0; i < (count % 2 == 0 ? count / 2 : count / 2 + 1); i++)
            {
                var imageFile = string.Concat("~/Content/upload/travelcity/", Model[2 * i].Image); 
            <div class="it">
                <div class="img">
                    <div class="img-inner">
                        <a href="@Url.Action("TravelDetail", "Style", new { idTravelCity = Model[2 * i].Id })">
                            <img src= "@Url.Content(imageFile)" style="width:100px; height:100px" alt="" />
                        </a>
                    </div>
                </div>
                <h4><a class="title" href="@Url.Action("TravelDetail", "Style", new { idTravelCity = Model[2 * i].Id })">@Model[2 * i].Name</a></h4>
                <small class="price">Giá: @Model[2 * i].Price</small>
                <small class="tripcode">Mã: @Model[2 * i].TripCode</small>
                <small class="tripcode">Thời gian: @Model[2 * i].Time</small>
                <small class="journey">@Model[2 * i].Duration</small>
            </div>
            }
        }
    </div>
    <!--/ .span6-->
    <div class="span6 wheretosay">
        @{
            for (int i = 0; i < (count % 2 == 0 ? count / 2 : count / 2 + 1); i++)
            {
                if (2 * i + 1 < count)
                {
                    var imageFile = string.Concat("~/Content/upload/travelcity/", Model[2 * i + 1].Image);
            <div class="it">
                <div class="img">
                    <div class="img-inner">
                        <a href="@Url.Action("TravelDetail", "Style", new { idTravelCity = Model[2 * i + 1].Id })">
                            <img src= "@Url.Content(imageFile)" style="width:100px; height:100px" alt="" />
                        </a>
                    </div>
                </div>
                <h4><a class="title" href="@Url.Action("TravelDetail", "Style", new { idTravelCity = Model[2 * i + 1].Id })">@Model[2 * i + 1].Name</a></h4>
                <small class="price">Giá: @Model[2 * i + 1].Price.</small>
                <small class="tripcode">Mã: @Model[2 * i + 1].TripCode</small>
                <small class="tripcode">Thời gian: @Model[2 * i + 1].Time</small>
                <small class="journey">@Model[2 * i + 1].Duration</small>
            </div>
                }
            }
        }
    </div>

    <div class="pagination pagination-centered">
        <p class="pull_right">
            Page @(Model.PageCount < Model.PageNumber ? 0 : Model.PageNumber)
            of @Model.PageCount Items
        </p>
        <ul>
            @for (int i = 1; i <= Model.PageCount; i++)
            {
                if (i == Model.PageNumber)
                {
                <li class="active"><a href="#">@i</a></li>
                }
                else
                {
                <li><a data-state_style="@ViewBag.IdStyle" class="page-number-listtravel" href="javascrip:void();">@i</a></li>
                }
            }
        </ul>
    </div>
</div>
